package drive;
import java.io.IOException;
import java.util.Properties;

public class DriveLocations {

	private static final String CLYDE_LOC = "Clyde_location";
	private static final String BONNIE_LOC = "Bonnie_Location";
	private static final String SD_CARD_LOC = "SD_Card_Location";

	public static final String CLYDE = getDriveLocation(CLYDE_LOC);
	public static final String BONNIE = getDriveLocation(BONNIE_LOC);
	public static final String SD_CARD = getDriveLocation(SD_CARD_LOC);

	public static String getDriveLocation(String driveName) {
		Properties props = new Properties();
		String result = null;
		try {
			try {
				props.load(DriveLocations.class
						.getResourceAsStream("/DriveLocations.properties"));
				result = props.getProperty(driveName);
				if (result == null) {
					throw new NoDataException();
				}
			} catch (IOException e) {
				throw new NoDataException();
			}
		} catch (NoDataException e) {
			e.printStackTrace();
		}
		return result;
	}

	public static void main(String[] args) {
		System.out.println("TEST");
		System.out.println(BONNIE);
		System.out.println(CLYDE);
		System.out.println(SD_CARD);
		System.out.println("DONE");
	}
}
